#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int N=2e5+10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
//----------------------------------------------------------------------------//

void solve()
{
	int n, k;
    cin >> n >> k;
    vector<int> a(n, -1000);
    int t = 0;
    while((t + 1) * (t + 2) / 2 <= k) t++;
    
    for(int i = 0; i < t; i++) a[i] = 1;
    
    k -= t * (t + 1) / 2;
    
    if (k)
	{
        a[t] = k - t - 1;
        a[k - 1] = 500;
    }

    for(auto x : a) cout << x << ' ';
    cout << '\n';


}

int main()
{
	close();
	int T; cin>>T;
	while (T--) solve();
	return 0;
}

